ns('J3D.Testcase').Main = 
  (function() {
     var test = function(f, input, output, equal) {
       equal = equal || function(x, y) {
         return x == y;
       };
       if (input.length !== output.length) {
         throw('Input and output are not match');
       }
       for (var i = 0, l = input.length; i < l; i++) {
         var inp = input[i].length ? input[i] : [input[i]];
         if (!equal(f.apply(null, inp), output[i])) {
           return 'case ' + i + ' failed';
         }
       }
       return 'all case passed';
     };
     return {
       test: test
     };
   })();
